﻿@model IEnumerable<Coleotrack.Data.Project>
@using MvcContrib.UI.Grid

@{
    Layout = null;
}

<div id="list">
<p id="success">
    Success
</p>

@if (Model.Count() > 0)
   {

    @Html.Grid(Model).Columns(column =>
                                        {
                                            column.For(
                                                x => Html.Partial("_Checkbox", x))
                                                .Named(Html.Partial("_CheckAll").ToString())
                                                .Attributes(@class => "command-column")
                                                .HeaderAttributes(@class => "command-column")
                                                .Encode(false).Sortable(false);
                                            column.For(
                                                x => Html.ActionLink(x.Name, "Edit", "Project", new {id = x.Id}, null)).
                                                Named("Name").Encode(false);
                                            column.For(x => x.Description);
                                            column.For(
                                                x =>
                                                Html.ActionLink(x.ContactPerson.Name, "Edit", "User",
                                                                new {id = x.ContactPerson.Id}, null)).Named(
                                                                    "Contact person").Encode(false);
                                        })
   } else { 
    <p>No data available.</p>
  } 

</div>
